//
//  ZhuanTicellCollectionViewCell.m
//  礼物说
//
//  Created by dllo on 16/4/26.
//  Copyright © 2016年 sunzhichao. All rights reserved.
//

#import "ZhuanTicellCollectionViewCell.h"

@interface ZhuanTicellCollectionViewCell ()

@property (nonatomic, retain) BaseImageView * imgView;

@end


@implementation ZhuanTicellCollectionViewCell

- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        
        [self createCell];
    }
    return self;
}
- (void)dealloc{
    
    [_imgView release];
    [_model release];
    [super dealloc];
    
    
}
- (void)setModel:(ZhuanTiModel *)model{
    if (_model != model) {
        [_model release];
        _model = [model retain];
    }
    
    [_imgView sd_setImageWithURL:[NSURL URLWithString: _model.banner_image_url] placeholderImage:PLACEHOLDER_IMAGE];
}

- (void)createCell{
    
    self.imgView = [[BaseImageView alloc] init];
    [self.contentView addSubview:_imgView];
    [_imgView release];
    
    
}
- (void)applyLayoutAttributes:(UICollectionViewLayoutAttributes *)layoutAttributes{
    
    [super layoutSubviews];

    _imgView.frame = CGRectMake(0, 0, kWIDTHCELL, kHEIGHTCELL);
    _imgView.layer.cornerRadius = 10;
    _imgView.layer.masksToBounds = YES;
    
    
}


@end
